import type { RouteRecordRaw } from "vue-router";
import {
  loginPath,
  noPermissionPath,
  noFoundPath,
  // registerPath,
} from "@/router/config";

export default [
  {
    path: loginPath,
    name: "Login",
    meta: {
      title: "登录",
      keepAlive: false,
      layout: {
        header: false,
        footer: false,
        sidebar: false,
        bodyShimPadding: 0,
      },
      menu: {
        show: false,
      },
    },
    component: () => import("@/pages/common/Login.vue"),
  },
  /*
  {
    path: registerPath,
    name: "Register",
    meta: {
      title: "注册",
      keepAlive: false,
      layout: {
        header: false,
        footer: false,
        sidebar: false,
        bodyShimPadding: 0,
      },
      menu: {
        show: false,
      },
    },
    component: () => import("@/pages/common/Register.vue"),
  },
  */
  {
    path: noPermissionPath,
    name: "NoPermission",
    meta: {
      title: "无权限",
      keepAlive: true,
      menu: {
        show: false,
      },
    },
    component: () => import("@/pages/common/NoPermission.vue"),
  },
  {
    path: noFoundPath,
    name: "NotFound",
    meta: {
      title: "未找到",
      keepAlive: true,
      menu: {
        show: false,
      },
    },
    component: () => import("@/pages/common/NotFound.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    name: "NoFoundMatch",
    meta: {
      title: "未找到",
      keepAlive: false,
      menu: {
        show: false,
      },
    },
    redirect: (to) => {
      return {
        path: noFoundPath,
        query: {
          target: encodeURIComponent(to.fullPath),
        },
      };
    },
  },
] as RouteRecordRaw[];
